主题
按键 - KeyPress
函数简介
按下指定的虚拟键码。
接口名称
KeyPressDLL调用
int KeyPress(long ola, int vk_code);参数说明
| 参数名 | 类型 | 说明 |
|---|---|---|
| ola | 长整数型 | OLAPlug对象的指针,由 CreateCOLAPlugInterFace 接口生成。 |
| vk_code | 整数型 | 虚拟键码(Virtual-Key Code)。可填 十六进制(如 0x0D)或 十进制(如 13),二者等价。完整常量、十进制对照与 字符串别名(KeyPressCharMap) 见 虚拟键码表。 |
示例
SDK 调用
cpp
#include "OLAPlugServer.h"
OLAPlugServer ola;
ola.KeyPress(65);csharp
using OLAPlug;
var ola = new OLAPlugServer();
ola.KeyPress(65);python
from OLAPlugServer import OLAPlugServer
ola = OLAPlugServer()
ola.KeyPress(65)java
import com.olaplug.OLAPlugServer;
OLAPlugServer ola = new OLAPlugServer();
ola.KeyPress(65);cpp
var ola = com("OlaPlug.OlaSoft")
ola.KeyPress(65);vbscript
Set ola = CreateObject("OlaPlug.OlaSoft")
ola.KeyPress(65);text
.局部变量 ola, OLAPlug
ola.创建 ()
ola.KeyPress(65)aardio
import OLAPlugServer;
var ola = OLAPlugServer();
ola.KeyPress(65);text
变量 ola <类型 = OLAPlugServer>
ola = 新建 OLAPlugServer
ola.KeyPress(65);cpp
#include "OLAPlugServer.h"
OLAPlugServer ola;
ola.KeyPress(65);原生 DLL 调用
cpp
long instance = CreateCOLAPlugInterFace();
KeyPress(instance, 65);csharp
long instance = CreateCOLAPlugInterFace();
KeyPress(instance, 65);python
from ctypes import CDLL, c_int, c_int64, create_string_buffer
ola = CDLL("OLAPlug_x64.dll")
ola.CreateCOLAPlugInterFace.restype = c_int64
instance = ola.CreateCOLAPlugInterFace()
KeyPress(instance, 65)返回值
1 成功,0 失败。
